home *** CD-ROM | disk | FTP | other *** search
/ This Disc Bytes! / Power Computing - The Disc 2 - This Disc Bytes.ISO / pc / codewarr / macossup / headers / universa / shutdown.h < prev    next >
Text File  |  1995-07-06  |  3KB  |  113 lines

  1. /*
  2.      File:        ShutDown.h
  3.  
  4.      Contains:    Shutdown Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __SHUTDOWN__
  21. #define __SHUTDOWN__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __MIXEDMODE__
  30. #include <MixedMode.h>
  31. #endif
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37. #if PRAGMA_ALIGN_SUPPORTED
  38. #pragma options align=mac68k
  39. #endif
  40.  
  41. #if PRAGMA_IMPORT_SUPPORTED
  42. #pragma import on
  43. #endif
  44.  
  45.  
  46. enum {
  47.     sdOnPowerOff                = 1,                            /*call procedure before power off.*/
  48.     sdOnRestart                    = 2,                            /*call procedure before restart.*/
  49.     sdOnUnmount                    = 4,                            /*call procedure before unmounting.*/
  50.     sdOnDrivers                    = 8,                            /*call procedure before closing drivers.*/
  51.     sdRestartOrPower            = 3                                /*call before either power off or restart.*/
  52. };
  53.  
  54. /*
  55.         ShutDwnProcPtr uses register based parameters on the 68k and cannot
  56.         be written in or called from a high-level language without the help of
  57.         mixed mode or assembly glue.
  58.  
  59.             typedef pascal void (*ShutDwnProcPtr)(short shutDownStage);
  60.  
  61.         In:
  62.          => shutDownStage    D0.W
  63. */
  64.  
  65. #if GENERATINGCFM
  66. typedef UniversalProcPtr ShutDwnUPP;
  67. #else
  68. typedef Register68kProcPtr ShutDwnUPP;
  69. #endif
  70.  
  71. enum {
  72.     uppShutDwnProcInfo = kRegisterBased
  73.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterD0, SIZE_CODE(sizeof(short)))
  74. };
  75.  
  76. #if GENERATINGCFM
  77. #define NewShutDwnProc(userRoutine)        \
  78.         (ShutDwnUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppShutDwnProcInfo, GetCurrentArchitecture())
  79. #else
  80. #define NewShutDwnProc(userRoutine)        \
  81.         ((ShutDwnUPP) (userRoutine))
  82. #endif
  83.  
  84. #if GENERATINGCFM
  85. #define CallShutDwnProc(userRoutine, shutDownStage)        \
  86.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppShutDwnProcInfo, (shutDownStage))
  87. #else
  88. /* (*ShutDwnProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  89. #endif
  90.  
  91. extern pascal void ShutDwnPower(void)
  92.  THREEWORDINLINE(0x3F3C, 0x0001, 0xA895);
  93. extern pascal void ShutDwnStart(void)
  94.  THREEWORDINLINE(0x3F3C, 0x0002, 0xA895);
  95. extern pascal void ShutDwnInstall(ShutDwnUPP shutDownProc, short flags)
  96.  THREEWORDINLINE(0x3F3C, 0x0003, 0xA895);
  97. extern pascal void ShutDwnRemove(ShutDwnUPP shutDownProc)
  98.  THREEWORDINLINE(0x3F3C, 0x0004, 0xA895);
  99.  
  100. #if PRAGMA_IMPORT_SUPPORTED
  101. #pragma import off
  102. #endif
  103.  
  104. #if PRAGMA_ALIGN_SUPPORTED
  105. #pragma options align=reset
  106. #endif
  107.  
  108. #ifdef __cplusplus
  109. }
  110. #endif
  111.  
  112. #endif /* __SHUTDOWN__ */
  113.